#ifndef ROUTEEDITDIALOG_H
#define ROUTEEDITDIALOG_H

#include <QDialog>
#include <QLineEdit>
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
#include "routemanagerdialog.h"
#include <QCheckBox>

class RouteEditDialog : public QDialog {
    Q_OBJECT
public:
    RouteEditDialog(QWidget *parent = nullptr);
    void setRoute(const RouteEntry &entry, const QStringList &ifaceList);
    RouteEntry getRoute() const;
private slots:
    void onAccept();
private:
    // 静态路由字段
    QLineEdit *editDest = nullptr; // 目标网络
    QComboBox *comboMask = nullptr; // 子网掩码
    QLineEdit *editGw = nullptr;
    QComboBox *comboIface = nullptr;
    QLineEdit *editMetric = nullptr;
    QComboBox *comboType = nullptr;
    QLineEdit *editDesc = nullptr;
    QPushButton *btnOk;
    QPushButton *btnCancel;
    QPushButton *btnHelp;
    void setupUi();
    bool validate(const RouteEntry &entry, QString &errMsg) const;
};

#endif // ROUTEEDITDIALOG_H 